export function generateAdditionCommutative(difficulty: 1 | 2 = 1): {
  content: string;
  solution: string;
  difficulty: number;
  knowledge_code: string;
  question_type: string;
} {
  // 算法说明：第一项和第三项可以凑100。第二项可以任意。
  
  if (difficulty === 1) {
    const a = Math.floor(Math.random() * 90) + 10; // 10-99
    const b = Math.floor(Math.random() * 90) + 10;
    const c = 100 - a;
    return {
      content: `${a}+${b}+${c}`,
      solution: `${a}+${b}+${c} = ${a}+${c}+${b} = ${b}+${a}+${c} = ${b}+${c}+${a} = ${c}+${a}+${b} = ${c}+${b}+${a} = ${a+b+c}`,
      difficulty,
      knowledge_code: '3.1.1_jiafa-jiaohuanlü',
      question_type: 'fill_in_blank'
    };
  } else {
    const a = Math.floor(Math.random() * 900) + 100; // 100-999
    const b = Math.floor(Math.random() * 900) + 100;
    const c = 1000 - a - b;
    return {
      content: `${a}+${b}+${c}`,
      solution: `${a}+${b}+${c} = ${a}+${c}+${b} = ${b}+${a}+${c} = ${b}+${c}+${a} = ${c}+${a}+${b} = ${c}+${b}+${a} = ${a+b+c}`,
      difficulty,
      knowledge_code: '3.1.1_jiafa-jiaohuanlü',
      question_type: 'fill_in_blank'
    };
  }
}